FocusLost
TheFocusLost
method is called to notify this part that one of its display frames has lost the specified focus.
void FocusLost (in ODTypeToken focus, in ODFrame ownerFrame);
focus
- A tokenized string representing the focus type that was lost, expressed as a 32-bit value.
ownerFrame
- A reference to a display frame that has lost the focus.
DISCUSSION
Thefocus
parameter must be the tokenized form of one of the focus constants (kODClipboardFocus
,kODKeyFocus
,kODMenuFocus
,kODModalFocus
,kODMouseFocus
,kODScrollingFocus
, orkODSelectionFocus
) or the tokenized form of a part-specific focus type. You can call the session object'sTokenize
method to obtain a token corresponding to one of these constants.OpenDoc calls this method to notify this part that the ownership of a focus has been unilaterally removed. For example, a focus module might detect that some physical hardware connection has been broken. Or if a containing part uses the arbitrator's
TransferFocus
method to transfer a focus directly from one embedded part to another, the focus module calls the source part'sFocusLost
method.Your part's
FocusLost
method is not called when this part loses a focus because another part has requested it (that is, using the arbitrator'sRequestFocus
andRequestFocusSet
methods). In this case, the part'sCommitRelinquishFocus
method is called if the part agrees to relinquish the focus.Your part's
FocusLost
method should perform any actions necessary to indicate that it has lost the focus (for example, closing connections and removing highlighting). Your part should avoid inappropriate behavior after it has lost the focus. For example, your part should not attempt to adjust menus or display a menu bar when your part does not have the menu focus.OVERRIDING
When you subclassODPart
, you must override this method. Your override method must not call its inherited method; that is, your override method must implement this method's functionality completely.EXCEPTIONS
kODErrInvalidFrame
- The specified frame is not a display frame of this part.
SEE ALSO
TheODFocusType
type (page 889).
TheODTypeToken
type (page 877).
TheODPart::AbortRelinquishFocus
method (page 475).
TheODPart::BeginRelinquishFocus
method (page 482).
TheODPart::CommitRelinquishFocus
method (page 488).
TheODPart::FocusAcquired
method (page 517).
TheODSession::Tokenize
method (page 622).
"The FocusLost Method" on page 92 in OpenDoc Cookbook.
Table 2-1 on page 89 in OpenDoc Programmer's Guide.
"Transferring Focus Without Negotiation" on page 209 in OpenDoc Programmer's Guide.
"On Frame Activation" on page 211 in OpenDoc Programmer's Guide.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help